package k.b.s;

import k.b.s.R.drawable;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Toast;

public class MyListView extends ListView{
	private int mOverscrollDistance = 0;
	private final String TAG = "ListView";
	private int flg = 0;

	public MyListView(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
	}

    public MyListView(Context context, AttributeSet attrs) {
        super(context, attrs);
       }

       public MyListView(Context context, AttributeSet attrs, int defStyle) {
           super(context, attrs, defStyle);
       }

    @Override
    protected boolean overScrollBy(int deltaX, int deltaY, int scrollX, int scrollY, int scrollRangeX, int scrollRangeY, int maxOverScrollX, int maxOverScrollY, boolean isTouchEvent) {
     return super.overScrollBy(deltaX, deltaY, scrollX, scrollY, scrollRangeX, scrollRangeY, maxOverScrollX, mOverscrollDistance, isTouchEvent);
    }
    // オーバースクロール実行後
    @Override
    protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX,
                    boolean clampedY) {
    	Log.v(TAG, "scrollX:" + scrollX + " scrollY:" + scrollY + " clampedX:"
                            + clampedX + " clampedY:" + clampedX);
    	super.onOverScrolled(scrollX, scrollY, clampedX, clampedY);

    	if(scrollY == -100) {
    		flg = 1;
    		Log.v("MyListView", "flg = " + flg);
    	}
   		if(scrollY == 0 && flg == 1){
       		flg = 0;
       		Log.v("MyListView", "flg = " + flg);
//   			ListViewActivity.pullToReload();
   		}
    }
}
